<?php
/**
 * This file is part of Task Agile.
 * Task Agile is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License.
 * Task Agile is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Task Agile.  If not, see <http://www.gnu.org/licenses/>.
 *
 * @category   TaskAgile
 * @package    Controller
 * @copyright  Copyright (c) 20010-2010 Estrada Virtual (http://estradavirtual.com.br)
 * @license    http://www.gnu.org/licenses/gpl.txt GPLv3
 * @version    $Id$
*/
?>
<h3>Cadastro de Projeto</h3>
<div id="divFormulario">
    <form action="<?php echo $this->baseUrl() ?>/task/project/save" method="post" name="form" id="form">
        <input type="hidden" name="id" id="id" value="<?php echo $this->project->id ?>" />
			<div class="label">
            	<label for="fk_project"><?php echo $this->translate('fk_enterprise'); ?>&nbsp;<span class="campoObrigatorio">*</span>: </label>
           	</div>
           	<div class="form-item">
            	<?php echo $this->formSelect('fk_enterprise', $this->project->fk_enterprise, array('id' => 'fk_enterprise', 'title' => $this->translate('fk_enterprise'), 'class' => 'required'), $this->enterprises); ?>
			</div><br />
			
			<div class="label">
            	<label for="name"><?php echo $this->translate('name'); ?>&nbsp;<span class="campoObrigatorio">*</span>: </label>
           	</div>
           	<div class="form-item">
            	<input class="required" type="text" name="name" id="name" value="<?php echo $this->project->name; ?>" title="<?php echo $this->translate( "name"); ?>"  maxlength="45" />
			</div><br />

			<div class="label">
            	<label for="name"><?php echo $this->translate('priority'); ?>&nbsp;<span class="campoObrigatorio">*</span>: </label>
           	</div>
           	<div class="form-item">
            	<?php echo $this->formSelect('priority', $this->project->priority, array('id' => 'priority', 'title' => $this->translate('priority'), 'class' => 'required'), $this->prioritys); ?>
			</div><br />

			<div class="label">
            	<label for="status"><?php echo $this->translate('status'); ?>&nbsp;<span class="campoObrigatorio">*</span>: </label>
           	</div>
           	<div class="form-item">
            	<?php echo $this->formSelect('status', $this->project->status, array('id' => 'status', 'title' => $this->translate('status'), 'class' => 'required'), $this->status); ?>
			</div><br />
			
			<?php if ($this->project->dt_register) : ?>
	            <div class="label">
	            	<?php echo $this->translate( "dt_register"); ?>&nbsp; :
	            </div>
	            <div class="form-item">
	            	<?php echo $this->dateFormat($this->project->dt_register); ?>
	            </div><br />
            <?php endif; ?>
            <?php if ($this->project->dt_finish) : ?>
	            <div class="label">
	            	<?php echo $this->translate( "dt_finish"); ?>&nbsp; :
	            </div>
	            <div class="form-item">
	            	<?php echo $this->dateFormat($this->project->dt_finish); ?>
	            </div><br />
            <?php endif; ?>

			<div class="button">
				<input type="submit" name="enviar" id="enviar" value="Gravar" />
			</div>
        <br /><hr />
        Usuários relacionados a este projeto: <br />
        <?php echo $this->formMultiCheckbox('users[]', $this->usersSelected, null, $this->users); ?>
    </form>
</div>
<script type="text/javascript">
$().ready(function() {
        $('#form').validate({ignoreTitle:true});
    });
</script>